package com.livegoods.hotproduct.controller;

import com.livegoods.commons.vo.LivegoodsResult;
import com.livegoods.hotproduct.service.HotProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName : ItemController
 * @Description :
 * @Author : ZWZ
 * @Date: 2021/8/23 15:35
 */
@RestController
// 跨域
@CrossOrigin
public class HosProductController {

    @Autowired
    private HotProductService hotProductService;

    @GetMapping("/hotProduct")
    public LivegoodsResult getHotProducts(@RequestParam(name = "city", required = true)
                                                  String city) {
        return hotProductService.getHotProducts(city);
    }

}
